<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="regionForm.title"/></title>
    <meta name="heading" content="<fmt:message key='regionForm.heading'/>"/>
    <meta name="menu" content="RegionFormMenu"/>
    <script type="text/javascript" src="<c:url value='/scripts/jquery/ui/jquery.ui.button.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/jquery/ui/jquery.ui.datepicker.js'/>"></script>
    <style>
		#toolbar {
			padding: 10px 10px;
		}
		#toolbar2 {
			padding: 10px 10px;
		}
		#vesselName,#vesselCode,#vesselAge,#vesselWeight,#vesselCountry,#vesselDescription{
			height: 20px;
			margin-right: 20px;
			margin-top: 12px;
		}
		
	</style>
</head>


<div class="buttons" style="float:left;padding-right:15px;margin-top: 20px;">
	<form:form commandName="region" method="post" action="regionForm.html" onsubmit="return onFormSubmit(this)" id="regionForm">
		<form:hidden path="id"/>
		<fieldset class="ui-widget ui-widget-content" style="width: 100%;margin-top: 12px; margin-bottom: 12px;">
			<legend class="ui-widget-header ui-corner-all">
				<fmt:message key="regionForm.heading" />
			</legend>
		    <table>
				<tr>
					<td>
				        <appfuse:label styleClass="desc" key="regionData.code"/>
			        </td>
			        <td>
				        <form:errors path="code" cssClass="fieldError"/>
				        <form:input path="code" id="regionCode" class="ui-widget-content ui-corner-all"  cssErrorClass="text large error"/>
				   </td>
			   </tr>
		   <tr>
		   <td>
		        <appfuse:label styleClass="desc" key="regionData.name"/>
		        </td>
		        <td>
		        <form:errors path="name" cssClass="fieldError"/>
		        <form:input path="name" id="regionName" class="ui-widget-content ui-corner-all"  cssErrorClass="text large error"/>
		   </td>
		   </tr>
		   <tr>
		   <td valign="top">
		        <appfuse:label styleClass="desc" key="regionData.description"/>
		        </td>
		        <td>
		        <form:errors path="description" cssClass="fieldError"/>
		        <form:textarea path="description" id="regionDescription" class="text-area ui-widget-content ui-corner-all"  cssErrorClass="text large error"/>
		   </td>
		   </tr>
		   </table>
		</fieldset>
	
	    <span id="toolbar">
		<button type="submit" id="add_maven2" class="button" name="save" onclick="bCancel=false">
			<fmt:message key="button.save"/>
		</button>
	
		<c:if test="${param.from == 'list' and param.method != 'Add'}">
			<button type="submit" id="delete_maven2" class="button" name="delete" onclick="bCancel=true;return confirmDelete('Region Data')">
		         <fmt:message key="button.delete"/>
			</button>
		</c:if>
	
	    <button type="submit" id="cancel_maven2" class="button" name="cancel" onclick="bCancel=true" value="<fmt:message key="button.cancel"/>"/>
	    <fmt:message key="button.cancel"/>
		</button>
	</span>
	</form:form>
</div>
<script type="text/javascript">
	$("#add_maven" ).button({
	    icons: {
	        primary: "ui-icon-circle-plus"
	    }
	});
	
	$("#delete_maven" ).button({
	    icons: {
	        primary: "ui-icon-circle-minus"
	    }
	});
	
	$("#cancel_maven" ).button({
	    icons: {
	        primary: "ui-icon-circle-close"
	    }
	});
	
	$("#add_maven2" ).button({
	    icons: {
	        primary: "ui-icon-circle-plus"
	    }
	});
	
	$("#delete_maven2" ).button({
	    icons: {
	        primary: "ui-icon-circle-minus"
	    }
	});
	
	$("#cancel_maven2" ).button({
	    icons: {
	        primary: "ui-icon-circle-close"
	    }
	});
</script>